#include <stdio.h>
int fib(int a)
{
	if (a == 0) { return 0; }
	if (a == 1) { return 1; }
	int f[a + 1];
	f[0] = 0;
	f[1] = 1;
	int n;
	for (n = 2; n <= a; n++)
	{
		f[n] = f[n-1] + f[n-2];
	}
	return f[a];
}

int main(int argc, char * argv[])
{
	printf("fib(9) = %d\n", fib(9));
	return 0;
}
